library MK2Transmission initializer init 

	private function MK2FuelCondition takes nothing returns boolean
		return GetLearnedSkill()=='A00N'
	endfunction
	
	private function MK2FuelTransmission takes nothing returns nothing
		local player p = GetTriggerPlayer()
		local integer i = GetConvertedPlayerId(p)
		if GetLearnedSkill()=='A00N' then
			set udg_FuelEfficiency[i] = udg_FuelEfficiency[i]*0.9
			call SetPlayerTechResearched( p, 'R006', GetPlayerTechCount(p,'R006',true)+1 )
			if GetUnitAbilityLevel(GetTriggerUnit(),'A00N')==5 and udg_Mode!=3 then
				call DisableTrigger(GetTriggeringTrigger())
			endif
		endif
		set p = null
	endfunction

	private function init takes nothing returns nothing
		local trigger t
		set t = CreateTrigger(  )
		call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_HERO_SKILL)
		call TriggerAddCondition(t, Condition(function MK2FuelCondition))
		call TriggerAddAction( t, function MK2FuelTransmission )
	endfunction

endlibrary